<?xml version="1.0"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">


<type name="msg">
 
 <annotation> 
  <documentation>
   Message package library.
  </documentation>
  <contributors> <![CDATA[
   Eugene Efremov <4mirror@mail.ru>
  ]]> </contributors>
 </annotation>

 <region name="message" parent="def:Text"/>

 <region name="quote.first" parent="def:String"/>
 <region name="quote.next" parent="def:ParameterStrong"/>
 <region name="quote.edge" parent="def:StringEdge"/>

 <region name="quote.uue" parent="def:Comment"/>
 <region name="quote.printable" parent="quote.uue"/>
 <region name="quote.64" parent="quote.uue"/>

 <region name="header.start" parent="def:OpenTag"/>
 <region name="header.end" parent="def:CloseTag"/>
 <region name="header" parent="def:Tag"/>
 <region name="header.word" parent="def:Keyword"/>
 <region name="header.name" parent="def:String"/>
 
 <region name="tirline" parent="def:Var"/>
 <region name="param" parent="def:Parameter"/>
 <region name="origin" parent="def:Keyword"/>
 <region name="kludge" parent="def:KeywordStrong"/>
 <region name="kludge.unknow" parent="def:CommentContent"/>

 <region name="emu.u" parent="def:Var" description="_text_"/>
 <region name="emu.b" parent="def:Symbol" description="*text*"/>
 <region name="emu.i" parent="def:String" description="/text/"/>
 <region name="emu.ib" parent="def:StringContent" description="/*text*/"/>
 <region name="emu.iu" parent="def:VarStrong" description="/_text_/"/>
 <region name="emu.bu" parent="def:Keyword" description="_*text*_"/>
 <region name="emu.biu" parent="def:DeprecatedKeyword" description="_/*text*/_"/>
 <region name="emu.r" parent="def:Insertion" description="#text#"/>
 <region name="emu.smile" parent="def:SymbolStrong"/> 
 
 
 <scheme name="uri.content">
  <keywords region="def:Keyword">
   <symb name="@"/>
   <symb name="."/>
  </keywords>
  <keywords region="def:KeywordStrong">
   <symb name="$"/>
   <symb name="%"/>
  </keywords>
  <keywords region="def:Symbol">
   <symb name="_"/>
   <symb name="-"/>
  </keywords>  
 </scheme>
 
 <entity name="urc" value="[\w\d_\-\.\$\%]*"/>
 <entity name="email" value="[\w\d_]%urc;\@%urc;[\w\d_]"/>
 <scheme name="uri">
  <block start="/(&lt;)\M%email;&gt;/" 
   end="/~%email;\m(&gt;)/"
   scheme="uri.content" region="def:EMail"
   region01="def:String" region11="def:String"
  />
  <inherit scheme="def:NetAddresses"/>
 </scheme>
 
 
 <entity name="wrd" value="([\#\w].*[\#\w]|\w)"/> 
 <entity name="b64" value="[\w\d\+\/]"/>
 <scheme name="text.r">
  <regexp match="/\#(\w|\w.*\w)\#/" region="emu.r"/>
 </scheme>
 
 <scheme name="text">
  <inherit scheme="uri"/>

  <block start="/_\M%wrd;_/" end="/~%wrd;\m_/" region="emu.u" scheme="text.r"/>
  <block start="/\*\M%wrd;\*/" end="/~%wrd;\m\*/" region="emu.b" scheme="text.r"/>
  <block start="/\/\M%wrd;\//" end="/~%wrd;\m\//" region="emu.i" scheme="text.r"/>
  <block start="/\/\*\M%wrd;\*\//" end="/~%wrd;\m\*\//" region="emu.ib" scheme="text.r"/>
  <block start="/\/_\M%wrd;_\//" end="/~%wrd;\m_\//" region="emu.iu" scheme="text.r"/>
  <block start="/_\*\M%wrd;\*_/" end="/~%wrd;\m\*_/" region="emu.bu" scheme="text.r"/>
  <block start="/_\/\*\M%wrd;\*\/_/" end="/~%wrd;\m\*\/_/" region="emu.biu" scheme="text.r"/>
  <inherit scheme="text.r"/>
  
  <regexp match="/(^|\s)(\W)?[;:%8BX|=]([\-\*\+])?([/\\)(|*]+|[ObPFE]\~*|\(\s*\))(\s|$)/"  
   region="emu.smile"/>

 </scheme>
 
 <scheme name="subj">
  <regexp match="/~(\s?Re(\:)?\s?(\[(\d+)\])?(\:)?)+/"
   region="def:KeywordStrong" region3="def:Symbol" region4="def:Number"
  />
  <regexp match="/(\=\?)\S+\?\w\?
   ((%b64;{4})*(%b64;{2}\={2}|%b64;{3}\={1}|%b64;{4}))
   (\?\=)/x" 
   region="def:DeprecatedKeyword" region2="quote.64"
   region1="def:PairStart" region5="def:PairEnd"
  />
  <inherit scheme="text"/>
 </scheme>
 
 <entity name="quote" value="(\s?\w{0,5}&gt;)"/>
 <scheme name="quote">
  <block start="/^%quote;{4,}/" end="/$/"
   region="quote.next" scheme="text" region00="quote.edge"
  />
  <block start="/^%quote;{3}/" end="/$/"
   region="quote.first" scheme="text" region00="quote.edge"
  />
  <block start="/^%quote;{2}/" end="/$/"
   region="quote.next" scheme="text" region00="quote.edge"
  />
  <block start="/^%quote;/" end="/$/"
   region="quote.first" scheme="text" region00="quote.edge"
  />  
 </scheme>
 
 <scheme name="quote.printable">
  <regexp match="/\=[0-9A-F]{2}/" region="quote.printable"/>
  <regexp match="/\=$/" region="quote.printable"/>
  <inherit scheme="quote"/>
 </scheme> 

 <scheme name="quote.64">
  <regexp match="/^%b64;{76}$/" region="quote.64"/>
  <regexp match="/^(%b64;{4})*(%b64;{2}\={2}|%b64;{3}\={1}|%b64;{4})$/" region="quote.64"/>
 </scheme> 
 
 <scheme name="msg">
  <block start="/^(From|To)\:/" end="/$/" 
   scheme="text" region="header.name" region00="header.word"
  />
  <block start="/^Subj(ect)?\:/" end="/$/"
   scheme="subj" region="header" region00="header.word"
  />
  <inherit scheme="quote"/>
  <inherit scheme="text"/>
  <block start="/^\*\s\M\w/" end="/$/"
   scheme="msg:text" region="msg:tirline"
  />
 </scheme>
 
</type> 
     
</hrc>
<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is the Colorer Library.
   -
   - The Initial Developer of the Original Code is
   - Eugene Efremov <4mirror@mail.ru>
   - Portions created by the Initial Developer are Copyright (C) 2003-2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->
